package com.example.demo.mapper;

import com.example.demo.entiy.Dish;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishMapper {
    /**
     * delete by primary key
     * @param id primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Long id);

    /**
     * insert record to table
     * @param record the record
     * @return insert count
     */
    int insert(Dish record);

    /**
     * insert record to table selective
     *
     * @param record the record
     * @return insert count
     */
    Long insertSelective(Dish record);

    /**
     * select by primary key
     * @param id primary key
     * @return object by primary key
     */
    Dish selectByPrimaryKey(Long id);

    /**
     * update record selective
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(Dish record);

    /**
     * update record
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(Dish record);
    @Select("select * from dish where category_id = #{ids}")
    List<Dish> selectBycata(Long ids);

    Page<Dish> getInfo(int page, int pagesize, String name);

    List<Dish> selectBystutis(List<Long> ids);

    int deleteByids(List<Long> ids);

    int changeStatus(int status, List<Long> ids);

    List<Dish> getListdis(Long categoryid, String name);
}